﻿/*************************************************************************************
* 运行库版本：	4.0.30319.18408
* 类  名  称：	FtImageAdapter
* 命 名 空间：	FutureTech.Media.ComputerVision
* 文  件  名：	FtImageAdapter
* 创 建 时间：	2014/6/5 15:33:32
* 作      者：	帅红  shuaihong617@qq.com
* 说      明：
* 修 改 时间：
* 修  改  人：
*************************************************************************************/

using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace FutureTech.Media.ComputerVision
{
        
        /// <summary>
        /// 图像适配器
        /// </summary>
        public class BitmapImageAdapter
        {
                public BitmapImageAdapter(int left, int top)
                {
                        _left = left;
                        _top = top;
                }

                private int _left;

                public int Left
                {
                        get
                        {
                                Contract.Ensures(_left>=0 && _left <= SourceFtImage.Width - DestnationFtImage.Width);
                                return _left;
                        }
                        set { _left = value; }
                }

                private int _top;

                public int Top
                {
                        get
                        {
                                Contract.Ensures(_top >= 0 && _top <= SourceFtImage.Height - DestnationFtImage.Height);
                                return _top;
                        }
                        set { _top = value; }
                }

                public int Right
                {
                        get
                        {
                                Contract.Requires(SourceFtImage!= null, "源图像不能为空");
                                return SourceFtImage.Width + Left;
                        }
                }

                public int Bottom
                {
                        get
                        {
                                Contract.Requires(SourceFtImage != null, "源图像不能为空");
                                return SourceFtImage.Height + Top;
                        }
                }

                public BitmapImage SourceFtImage { get; set; }

                public BitmapImage DestnationFtImage { get; set; }

                public void UpdateDestnationFtImagePixels()
                {
                        Contract.Requires(SourceFtImage != null, "源图像不能为空");
                        Contract.Requires(DestnationFtImage != null, "目标图像不能为空");


                }
        }
}
